<?php
function treeTags($com, $style='treeTag')
{
    if (count($com)==0)
        return;
    
    foreach ($com as $val) {
        echo "<div class='treeTag3'>";
       echo "<div class='".$style."'><a href='/urp/tags/view/".$val['tags']['tag']."'>".$val['tags']['tag']."</a></div>";
       echo "<div class='hoverTag'>";
       if (isset($val['child'])) {
            if ($style=='treeTag')
               treeTags($val['child'], 'treeTag1');
            else
               treeTags($val['child'], 'treeTag');
       }
        echo "</div>";
        echo "</div>";
    }
   
}
treeTags($com);

?>